<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2018/10/16
  Time: 12:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <script src="js/jquery-2.2.4.min.js"></script>
    <script src="bootstrap/js/bootstrap.js"></script>
    <title>商品列表</title>
    <c:set var="root" value="${pageContext.request.contextPath}"/>
</head>
<body>
   <h3>商品列表</h3>
   <div class="container">
       <div class="row clearfix">
           <a href="${root}/addUIServlet">
           <button type="button" class="btn btn-default btn-primary">添加</button>
           </a>
           <div class="col-md-12 column">
               <table class="table table-hover table-striped">
                   <thead>
                   <tr>
                       <th>
                           序号
                       </th>
                       <th>
                           产品名称
                       </th>
                       <th>
                           操作
                       </th>
                   </tr>
                   </thead>
                   <tbody>
                   <c:forEach var="p" items="${list}" varStatus="status" >
                       <c:choose>
                           <c:when test="${status.count%2 == 0}">
                               <tr class="success">
                           </c:when>
                           <c:otherwise>
                               <tr class="warning">
                           </c:otherwise>
                       </c:choose>

                       <td>
                           ${status.count}
                       </td>
                       <td>
                           <a href="${root}/findDetailServlet?pid=${p.pid}"> ${p.pname}</a>
                       </td>
                       <td>
                           <a href="${root}/editUIServlet?pid=${p.pid}">
                               <button type="button" class="btn btn-default btn-primary">修改</button>
                           </a>

                           <button type="button" class="btn btn-default btn-primary">删除</button>
                       </td>
                   </tr>
                   </c:forEach>
                   </tbody>
               </table>
           </div>
       </div>
   </div>
</body>
</html>
